package com.fancy.middleware.netty.handler.codec;

import io.netty.handler.codec.LengthFieldBasedFrameDecoder;

/***
 * @Description:
 * 半包 粘包 解码器
 */
public class HalfAndGluedFrameDecoder extends LengthFieldBasedFrameDecoder {
    /****
     * <pre>
     * BEFORE DECODE (14 bytes)         AFTER DECODE (14 bytes)
     * +--------+----------------+      +--------+----------------+
     * | Length | Actual Content |----->| Length | Actual Content |
     * | 0x000C | "HELLO, WORLD" |      | 0x000C | "HELLO, WORLD" |
     * +--------+----------------+      +--------+----------------+
     * </pre>
     */
    public HalfAndGluedFrameDecoder() {
        super(1024, 0, 2, 0, 0);
    }

}
